<template>
	<div class="hotspace">
		<div class="title">热门景点</div>
		<!-- 循环展示每一项 -->
		<ul class="recommendList">
			<li class="item" v-for="item of recommendList" :key="item.id">
				<img :src="item.imgUrl" alt="" class="item-img">
				<div class="item-info">
					<p class="item-info-title">{{item.title}}</p>
					<p class="item-info-desc">{{item.desc}}</p>
          <router-link tag="button" class="item-btn" :to="'/detail/' + item.id" >查看详情</router-link>
					<!-- <button class="item-btn">查看详情</button> -->
				</div>
			</li>
		</ul>
	</div>
</template>
<script>
export default {
	name: 'homeHot',
	props: {
		recommendList: Array
	}
}
</script>
<style scoped>
	.title {
		background-color: #eee;
		line-height: .8rem;
		text-indent: .2rem;/*首行缩进*/
	}
	.item{/*每一个Li中的内容应当水平排列 因此对li使用流体布局*/
		display: flex;
		height: 1.9rem;
		overflow: hidden;
	}
	.item-img {
		width: 1.7rem;
		height: 1.7rem;
		padding: .1rem;
	}
	.item-info {
		flex: 1;
		padding: .2rem;
	}
	.item-info-title {
		line-height: .54rem;
		font-size: .32rem;
	}
	.item-info-desc {
		line-height: .4rem;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
		color: #ccc;
	}
	.item-btn {
		background-color: #ff9300;
		border-radius: .06rem;
		padding: 0 .2rem;
		margin-top: .16rem;
		line-height: .44rem; 
	}
</style>
